package com.marce.remis.flexClient.control
{
	import com.marce.remis.flexClient.vo.Usuario;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	
	public class Delegator
	{
		private static var instance:Delegator=null; 
		
		private var service:Service;
		public function Delegator(value:PrivateClass)
		{
			service = new Service();
		}
		
		public static function getInstance():Delegator{
			if(!instance) instance = new Delegator(new PrivateClass());
			return instance;
		}
		
		public function login(usuario:Usuario,responder:IResponder):void{
			var token:AsyncToken = service.remoteObjectService.login(usuario);
			token.addResponder(responder);
		}
		
		public function findRemisesToday(responder:IResponder):void{
			var token:AsyncToken = service.remoteObjectService.findRemisesToday();
			token.addResponder(responder);
		}
	}
}
	class PrivateClass{
		public function PrivateClass(){
			
		}
	}

